import request from '@/utils/request'

export function queryStartFormKey(params) {
  return request({
    url: '/flow/act/queryStartFormKey',
    method: 'get',
    params
  })
}
export function queryFormKeyList(params) {
  return request({
    url: '/flow/act/queryFormKeyList',
    method: 'get',
    params
  })
}
export function queryFormKeyListByProcInstId(params) {
  return request({
    url: '/flow/act/queryFormKeyListByProcInstId',
    method: 'get',
    params
  })
}

export function selectFormById(query) {
  return request({
    url: '/flow/coding/form/selectById',
    method: 'GET',
    params: query
  })
}

export function selectFormListByIds(query) {
  return request({
    url: '/flow/coding/form/selectFormListByIds',
    method: 'GET',
    params: query
  })
}

/**
 * 发起流程
 */
export function startProc(data) {
  return request({
    url: '/flow/act/startProcByProcDefKey',
    method: 'post',
    data
  })
}


/**
 * UI: queryStartFormData
 * @param {*} modelId
 */
export function queryStartFormProperties(params) {
  return request({
    url: '/flow/act/queryStartFormProperties',
    method: 'get',
    params
  })
}


export function queryTaskFormProperties(params) {
  return request({
    url: '/flow/act/queryTaskFormProperties',
    method: 'get',
    params
  })
}


/**
 * 我的任务列表
 */
export function listMyWaitingTask(data) {
  return request({
    url: '/flow/act/listMyWaitingTask',
    method: 'post',
    data
  })
}

/**
 * 我发起的流程
 */
export function listMyStartProcInst(data) {
  return request({
    url: '/flow/act/listMyStartProcInst',
    method: 'post',
    data
  })
}

/**
 * 我完成的任务
 */
export function listMyCompleteTask(data) {
  return request({
    url: '/flow/act/listMyCompleteTask',
    method: 'post',
    data
  })
}


/**
 * 流程图
 */
export function getFlowImgByProcInstId(procInstId) {
  return request({
    url: '/flow/act/getFlowImgByProcInstId?procInstId='+procInstId,
    method: 'get'
  })
}


/**
 * 完成任务
 */
export function completeTask(data) {
  return request({
    url: '/flow/act/completeByTaskId',
    method: 'post',
    data
  })
}

